package com.fyzk.view.widget;

import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.loadmore.LoadMoreView;
import com.fyzk.activity.app.App;
import com.fyzk.utils.NetworkUtils;
import com.tyjc.lottery.R;

public class CustomLoadMoreView extends LoadMoreView {

    @Override
    public int getLayoutId() {
        return R.layout.view_load_more;
    }

    @Override
    protected int getLoadingViewId() {
        return R.id.load_more_loading_view;
    }

    @Override
    protected int getLoadFailViewId() {
        return R.id.load_more_load_fail_view;
    }

    @Override
    protected int getLoadEndViewId() {
        return R.id.load_more_load_end_view;
    }

    @Override
    public void convert(BaseViewHolder holder) {
        super.convert(holder);
        if (NetworkUtils.isNetworkConnected(App.getContext())) {
            holder.setText(R.id.tv_prompt, R.string.load_failed);
        } else {
            holder.setText(R.id.tv_prompt, R.string.network_error_pop);
        }
    }
}
